package com.bus.boot.web;

import org.springframework.boot.web.servlet.ErrorPage;
import org.springframework.boot.web.servlet.ErrorPageRegistrar;
import org.springframework.boot.web.servlet.ErrorPageRegistry;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;

@Component
public class ConfigErrorPage implements ErrorPageRegistrar {

	@Override
	public void registerErrorPages(ErrorPageRegistry errorPage) {

		ErrorPage page_404 = new ErrorPage(HttpStatus.NOT_FOUND, "/404.html");
		ErrorPage page_403 = new ErrorPage(HttpStatus.NOT_FOUND,
				"/error/403.html");
		ErrorPage page_500 = new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR,
				"/error/500.html");
		errorPage.addErrorPages(page_403, page_404, page_500);
	}

}
